﻿<%@ Page Language="C#" ContentType="image/gif" %>
<%@ Import Namespace = "System.Drawing" %>
<%@ Import Namespace = "System.Drawing.Imaging" %>

<script runat="server">
    /// <summary>
    /// Sample 3 (C# example)
    /// Generate a GIF image with a red line diagonally across
    /// This example make use of the using-statements to handle disposal of resources
    /// </summary>
    /// <param name="sender"></param>
    /// <param name="e"></param>
    void Page_Load(object sender, EventArgs e)
    {
        using (Bitmap objBitmap = new Bitmap(200, 200))
        using (Graphics objGraphics = Graphics.FromImage(objBitmap))
        {
            objGraphics.DrawLine(new Pen(Color.Aquamarine), 0, 0, 200, 200);
            objBitmap.Save(Response.OutputStream, ImageFormat.Gif);
        }
    }
</script>